import request from '@/utils/request'
import {
  renderUrl
} from '../utils'

const headers = {
  'Content-Type': 'application/json'
}

export function add(data) {
  return request({
    url: '/operate/hotSearch/add',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function edit(data) {
  return request({
    url: '/operate/hotSearch/updateById',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function del(data) {
  return request({
    url: renderUrl('/operate/hotSearch/del/{id}', data),
    method: 'GET'
  })
}
export function top(data) {
  return request({
    url: '/operate/hotSearch/top',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export default {
  add,
  edit,
  del,
  top
}
